main(k)
{
	for(gets(&k);~scanf("%d",&k);)
			printf("%.f\n",ceil(.5+sqrt(12*k-3)/6));
}
